# -*- encoding=utf8 -*-
__author__ = "yangbj"

from airtest.core.api import *

auto_setup(__file__)

from poco.drivers.android.uiautomation import AndroidUiautomationPoco

poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)

if poco("发布学习/通知").exists():
    print("测试页")

elif poco("发布").exists() and poco("学习通知").exists():
    poco("发布").click()
elif poco("发布").exists() and poco("语音").exists():
    poco("语音").click()
else:
    stop_app("com.lj.ljshell")
    start_app("com.lj.ljshell")
    touch(Template(r"E:\tpl1562052236571.png", record_pos=(-0.417, -0.057), resolution=(1200, 1920)))
    for i in range(0, 60):
        if not poco("发布").exists():
            sleep(2)

    poco("发布").click()
    poco("语音").click()



